
USERNAME = ['zhangsan']
# 列表添加
USERNAME.append("admin")
print(USERNAME)
USERNAME.insert(1,'wangwang')
print(USERNAME)
gamename = ['dashen']
USERNAME.extend(gamename)
# iterable 迭代
print(USERNAME)


# 修改
USERNAME[3] = 'programmer'
# programmer 程序员
print(USERNAME)


# 查找
# 查找 programmer 是否在 username 列表中
SEARCHWORD = 'programmer'
if SEARCHWORD in USERNAME:
    print("[ %s ]在USERNAME列表中" % SEARCHWORD)
else:
    print("[ %s ]不在USERNAME列表中" % SEARCHWORD)

# SEARCHWORD = 'programmer'
# if SEARCHWORD not in USERNAME:
#     print("[ %s ]不在USERNAME列表中" % SEARCHWORD)
# else:
#     print("[ %s ]在USERNAME列表中" % SEARCHWORD)


# 删除
del USERNAME[1]
print(USERNAME)

USERNAME.pop()
print(USERNAME)

USERNAME.remove("zhangsan")
print(USERNAME)







